sec (7/9): redact only declared scanner secretEnv values#31
Conversation
494f412 to
1774bc0
Compare
dfd5ec2 to
17876cf
Compare
|
Codex review: found issues before merge. Reviewed July 26, 2026, 11:58 PM ET / July 27, 2026, 03:58 UTC. ClawSweeper reviewWhat this changesThis PR adds a Merge readinessKeep this PR open for a security-boundary and upgrade-safety correction. The new explicit Priority: P1 Review scores
Verification
How this fits togetherClawScan resolves profile-defined scanners into runner adapters, passes their declared environment variables into sandboxed commands, and records either raw JSON evidence or failure text in run artifacts. This PR changes which scanner environment values are removed from that failure text. flowchart LR
A[Profile scanner config] --> B[env and secretEnv declarations]
B --> C[User-defined scanner adapter]
C --> D[Sandboxed scanner command]
D --> E[Raw JSON evidence]
D --> F[Failure stderr and command error]
B --> G[Redaction selection]
G --> F
Decision needed
Why: The PR intentionally changes a credential-redaction boundary for already-valid user profiles, so maintainers must choose whether explicit configuration may silently replace the current name-based safety backstop. Before merge
Findings
Agent review detailsSecurityNeeds attention: The patch narrows an existing credential-redaction boundary and can expose token-like values from pre-existing scanner profile configuration. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep Do we have a high-confidence way to reproduce the issue? Yes from source inspection: configure a user-defined scanner with Is this the best way to solve the issue? No. Explicit Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2d4298abcc99. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
17876cf to
0300296
Compare
0300296 to
6268517
Compare
New behavior
User-defined scanners now have two explicit environment buckets:
Both variables are required and passed to the scanner. Only
secretEnvvalues are redacted from scanner failure text. A value placed only inenvremains visible even when its name containsTOKEN, so the configuration—not a naming heuristic—controls secrecy.For example, stderr:
is stored as:
Valid scanner stdout remains raw JSON evidence and is not rewritten. Scanner authors must not print secrets into that JSON.
This carries the intended
env/secretEnvcontract from the stale PR 22 onto currentmain.Verification
secretEnvbehavior and profile parsing tests — passedgo vet ./...— passedgo test -count=1 -skip 'TestResolveTargetClassifiesPlugin(Directory|ManifestFile)$' ./...— passed\n\nThe two excluded tests are unrelated existing macOS/varversus/private/varpath assertions; they run normally in Linux CI.